using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ComponentFactory.Krypton.Toolkit;

namespace OrionBanque.Forms
{
    public partial class AjoutChequier : ComponentFactory.Krypton.Toolkit.KryptonForm
    {
        private int idCompteA;

        public AjoutChequier(int idCompteP)
        {
            this.idCompteA = idCompteP;
            InitializeComponent();
            this.kLblCompteDestinataire.Text += "\"" + Classe.Compte.Charge(this.idCompteA).Libelle + "\"";
        }

        private void OK_Click(object sender, EventArgs e)
        {
            for (int i = Int32.Parse(kNudNumChequeDebut.Value.ToString()); i <= Int32.Parse(kNudNumChequeFin.Value.ToString()); i++)
            {
                Classe.Chequier c = new Classe.Chequier();
                c.IdCompte = this.idCompteA;
                c.IdOperation = 0;
                c.NumCheque = i;
                c.NumChequier = Int32.Parse(kNudNumChequier.Value.ToString());

                Classe.Chequier.Sauve(c);
            }

            this.Close();
        }
    }
}